home *** CD-ROM | disk | FTP | other *** search
/ Stolen Data 8 / Stolen Data 8.adf / TEXT / mfmarticle / mfmarticle
Text File  |  1989-08-16  |  6KB  |  206 lines

  1. @^
  2. @t4@f01@cTRACK LOADERS
  3.  
  4.  
  5. @t3@f00Typed by OMICRON of Dual Crew
  6.  
  7. @t5@f00O.K,  I  am  writing  this article and
  8. supplying   the   source  for  my  own
  9. personal custom track loader for three
  10. reasons.   Firstly,  because there are
  11. so  many  coders who don't really know
  12. how   tracks,   disks  and  MFM  work,
  13. because there is no such documentation
  14. in  any  of  the  technical  reference
  15. manuals,  which is really a shame, and
  16. secondly, because most people who code
  17. trackloaders  who  use  the  Operating
  18. System  functions, such as OPENDEVICE,
  19. and  READ  etc..., which is not really
  20. cool  because  reasons  which  I  will
  21. explain later, and thirdly, people who
  22. can  program  the disk hardware, don't
  23. @^
  24.  
  25. @t5
  26.  
  27. really  code  it  the way it should be
  28. done, this is why some loaders may not
  29. work  on  Amigas  with  delicate  disk
  30. drives,  and  drives  which are not as
  31. fast  as  others, anyway all this will
  32. be explained.
  33. @t3
  34. SO WHAT ABOUT THE TRACKDISK !
  35.  
  36. @t5
  37. The  trackdisk  is  the  part  of  the
  38. Kickstart  that  controls all the disk
  39. hardware  from an almost user friendly
  40. point of view.  You can do things like
  41. reading  tracks,  check for protection
  42. tabs,  etc.   And  you  can do alot of
  43. advanced  things  like read individual
  44. disk  blocks, and write to disks.  The
  45. @#
  46. @^
  47. @t5disadvantages are tenfold, firstly, as
  48. you   may   know,  to  use  the  Amiga
  49. Operating  system,  the system must be
  50. in  a fully working state, which means
  51. that  memory is going to be gobbled up
  52. lots and you cannot really rely on the
  53. state  of  your INTerupts+DMA and your
  54. Status  Register.   Everything on your
  55. disk  must really use the SAFE way, eg
  56. using   special   EXEC  functions  for
  57. creating  interupt  vectors, disabling
  58. interupts, memory management, and disk
  59. calls.   If  you start writing spurios
  60. data into the INTERUPT AUTOVECTORS, or
  61. change  your SR, or start fidling with
  62. copper  lists  and  DMA,  you may find
  63. that  your greatest demo does not work
  64. on as many Amigas as you would like it
  65. to  !  (LSD "DESPAIR" is an example of
  66. a  badly  coded  loader, coz the music
  67. cuts  when some new tracks are loaded,
  68. @^
  69. @t5most  likely  because this uses the OS
  70. in conjuction with INTERUPTS not setup
  71. in  a  friendly  manner).  Another big
  72. disadvantage   is   the  trackdisk  is
  73. terribly ssllooww and prone to errors.
  74. The  way  the  Operating  System deals
  75. with  disks  is totaly lame the way it
  76. is  supposed  to  (eg.  not reading on
  77. SYNC  marks and the timing of the disk
  78. step).  I don't know whether the error
  79. proneness  is  a bug in the OS or just
  80. my  machine,  coz sometimes the tracks
  81. loaded    with   the   trackdisk   are
  82. sometimes mashed, so don't quote me on
  83. that !!
  84.  
  85. @t3HARDWARE LOADER
  86. @t6---------------
  87. @t5
  88. OK  you've  coded  a  hardware loader,
  89. what are the advantages ??.  There are
  90. @#
  91. @^
  92. @t5quite alot !!  Firstly, you have total
  93. control  over  all  the memory and the
  94. system,  coz a real trackloader should
  95. not  use  the  OS, so there is no need
  96. for  the  OS  to  be  resident, so you
  97. don't  have  to  worry about the Amiga
  98. Hardware    conflicting    with    the
  99. operating  system.   Secondly, you can
  100. customize your drive speeds (you could
  101. have  a menu where the user can select
  102. a  fast/slow  trackload).  and you can
  103. customize your own disk format for say
  104. copy  protection  on  your latest cool
  105. game  to beat all the crackers.  There
  106. are  lots  of other advantages such as
  107. turning  the  trackloader  into an MFM
  108. file  loader,  which would work on the
  109. same  basis  as the OS deals with Data
  110. files,  you could even code the loader
  111. to  load  in executable files, and you
  112. could  write  your  own LIBRARY to use
  113. @^
  114. @t5all   these   functions  within  other
  115. programs.   You  may  even  change the
  116. loader  into  a  GCR  trackloader, and
  117. have  2X  as much data on your disks !
  118. THE SKYS THE LIMIT !!
  119.  
  120. @t3THE SOURCE
  121. @t6----------
  122. @t5
  123. On  this  magdisk is my own customized
  124. CYLINDER   loader  (a  CYLINDER  is  2
  125. tracks).   I  coded this loader, coz I
  126. used  C-MON  to write the executeables
  127. to  my  disk, and C-MON only writes in
  128. CYLINDERS.   But this should be no big
  129. deal  to  change  (I  have not done it
  130. personaly,   coz   I   haven't   coded
  131. anything  that really realies on cramp
  132. data).   I  will give ya a some of the
  133. advantages  of  using  this  loader in
  134. prods.
  135. @#
  136. @^
  137. @t5
  138. @t61.@t5 The loader source is very small 
  139.    (around 540 bytes), and is written 
  140.    to fit on a bootblock.  You can 
  141.    easily fit a small boot intro with 
  142.    it on the  BOOT as a BOOTBLOCK(S) 
  143.    is just 1K, or you could write in 
  144.    some boot text,to waste the 0's.
  145.  
  146. @t62.@t5 Uses real CIA timing for a 3 
  147.    millisecond wait for diskstep 
  148.    (no DBRA's !).
  149.  
  150. @t63.@t5 Header and Checksum verify (almost
  151.    guaranteed to load the specified 
  152.    track  without any errors !
  153.  
  154. @t64.@t5 Uses SYNC read + reasonable decoding
  155.    method.
  156.  
  157. @t65.@t5 Code is position independant.
  158. @^
  159. @t5
  160. @t66.@t5 Does not assume anything on boot, 
  161.    eg state of the SR, DMACON, INTENA
  162.    or even the ADKCON register !
  163.  
  164. @t67.@t5 Uses no part of the OS at all !
  165.  
  166. @t68.@t5 Tries to load the track in 10 
  167.    times, if failed flashing lights 
  168.    occur and the computer hangs !
  169.  
  170. I  am  not  saying that this loader is
  171. the  coolest  in the world, but it has
  172. taken me around 5 months on/off to get
  173. it  to  this stage, so I sure hope you
  174. use it and improve on it.  It may also
  175. not  be without bugs, but I am sure if
  176. you  are  gonna  use a trackloader for
  177. anything,  you  must be cool enough to
  178. fix    these    bugs.     Heres   some
  179. improvements that I thought of making.
  180. @#
  181. @k370,003,03
  182. @^
  183. @t5
  184. @t61.@t5 Blitter decoding
  185. @t62.@t5 4 Drive Capability
  186. @t63.@t5 Data Encrypting
  187. @t64.@t5 Decode one track while reading 
  188.    another
  189. @t65.@t5 Do something constructive during 
  190.    STEP waits
  191. @t66.@t5 Find some clever way of using 
  192.    SYNC + DISKBLK Interupts
  193. @t67.@t5 THE LIST GOES ON !! LOOK AT THE 
  194.    SPACE ACE LOADER !!!
  195.  
  196. To  know  more about Amiga Diskdrives,
  197. read   the  Abacus  Book  "AMIGA  DISK
  198. DRIVES  INSIDE AND OUT", which is lame
  199. in  parts, but should help you alot to
  200. know how it all really works !!.
  201.  
  202. Anyways I got to finish  this article
  203. LOVE ON YA !! @t2 Dual Crew 92
  204. @@
  205.  
  206.